import Vue from "vue";

import Vuex from "vuex";
import actions from "./actions.js";
import mutations from "./mutations.js";
import cart from "./modules/cart.js";
import shop from "./modules/shop.js";

Vue.use(Vuex);

// this.$store

//  npm run build 进入到 production
const store = new Vuex.Store({
  strict: process.env.NODE_ENV === "development", // 开启严格模式
  state: {
    count: 5,
  },
  mutations,
  actions,
  // 子文件夹
  modules: {
    cart,
    shop,
  },
});

export default store;
